package com.htc.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.htc.model.ProductComment;


public interface ProductCommentMapper{

	@Insert("INSERT INTO `productcomment` (`user_id`, `content`, `create_date`, `product_id`)"
			+ " VALUES (#{user_id},  #{content}, now(), #{product_id});")
	public void add(ProductComment t);
	
	@Delete("delete from productcomment where id=#{id}")
	public void del(int id);
	
	@Update("update productcomment set reply=#{reply} where id=#{id}")
	public void upadte(ProductComment t);
	
	@Select("select *,(select real_name from consumer where id=user_id)username from productcomment ${where}")
	public List<ProductComment> queryList(@Param("where")String where);
	
}
